<!DOCTYPE HTML>
<!--[if (gt IE 9)|!(IE)]><!--><html><!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="applicable-device" content="pc">
    <meta name="baidu-site-verification" content="Qu9OzfSVVJ" />
    <title>避风塘-确认订单</title>
    <link rel="shortcut icon" type="image/vnd.microsoft.icon" href="/static/img/favicon_1.ico">
    <link rel="icon" href="/static/img/favicon_1.ico" size="16x16 32x32">
    <link rel="stylesheet" href="__TMPL__/public/menu/sss/preview_981fd62e.css" />
</head>
<body>
<div class="wrapper">
    <div class="page-wrap">
        <div class="inner-wrap">
            <div class="clearfix order-confirm" id="j-order-confirm">
                <div class="order-info-wrapper j-order-info-wrapper clearfix">
                    <div class="fl address">
                        <table class="standard-table dishes-table">
                            <thead>
                            <tr class="bot-border">
                                <th class="left" width="240"><div class="th-inner align-left">订单号</div></th>
                                <th class="right" colspan="2"><div class="th-inner align-right orderid" ></div></th>
                            </tr>
                            <tr class="bot-border">
                                <th class="left" width="240"><div class="th-inner align-left">总金额(元)</div></th>
                                <th class="right" colspan="2"><div class="th-inner align-right all_money" ></div></th>
                            </tr>
                            <tr class="bot-border">
                                <th class="left" width="240"><div class="th-inner align-left">折扣(元)</div></th>
                                <th class="right" colspan="2"><div class="th-inner align-right zhekou" ><input class="amend" type="text" value=""></div></th>
                            </tr>
                            <tr class="bot-border">
                                <th class="left" width="240"><div class="th-inner align-left">实际付款(元)：</div></th>
                                <th class="right" colspan="2"><div class="th-inner align-right s_pay" ></div></th>
                            </tr>
                            </thead>
                        </table>
                        <div class="ticket-age"></div>

                    </div>
                    <div class="dishes">

                        <div class="pay-area">
                            <div class="tips ct-black">
                                <a class="s-btn  " id="confirmOrder" ><span class="s-btn ">会员卡</span></a>
                            </div>
                        </div>
                        <div class="pay-area">
                            <div class="tips ct-black">
                                <a class="s-btn "  id="amend"><span class="s-btn ">改账</span></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<script src="__TMPL__/public/menu/js/jquery.js"></script>
</body>
<script>
    var order=parent.$('.orderid').children('input').val();
    var all_money=parent.$('.all').html();
    $('.all_money').html(all_money);
    $('.s_pay').html(all_money);
    $('.orderid').html(order);
    /*
    * 余额支付
    * */
    $('#confirmOrder').click(function(){
        var order=$('.orderid').html();
        var s_pay=$('.s_pay').html();
        var state=1;
        var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
        $.post("{:url('orderpay/pay')}",{state:state,order:order,s_pay:s_pay},function(data){
            alert(data.msg);
            parent.$('.orderid').html('<input type="hidden" id="orderid" value="">');
            var src = '';
            parent.$('#cart').html(src);
            parent.$('.all').html(src);
            parent.layer.close(index); //执行关闭
        },'json')
    })
    /*
    * 改账
    * */
    $('#amend').click(function(){
        var order=$('.orderid').html();
        var zhekou=$('.amend').val();
        if(!isNaN(zhekou))
        {
          $.post("{:url('orderpay/amend')}",{order:order,zhekou:zhekou},function (data) {
             $('.s_pay').html(data.msg);
          },'json')
        }else{
            alert('请填写数字！')
            return false;
        }
    })
</script>
</html>
